function main() {

    var library_name = "libxlua.so" // ex: libsqlite.so
    var loaded = false
    Interceptor.attach(Module.findExportByName(null, 'android_dlopen_ext'), {
        onEnter: function (args) {
            var library_path = Memory.readCString(args[0])
            console.log("load library : " + library_path)
            if (library_path.includes(library_name)) {
                console.log("found library : " + library_path)
                loaded = true
            }
        },
        onLeave: function (args) {
            if (loaded) {

                {
                    var addr = Module.findExportByName(library_name, "luaL_loadbufferx")
                    console.log("luaL_loadbufferx:" + addr)
                    Interceptor.attach(ptr(addr), {
                        onEnter: function (args) {

                            var name = Memory.readCString(args[3])
                            console.log("--->" + name)

                        },
                        onLeave: function (retval) {

                        }
                    })
                }

                loaded = false
            }
        }
    })
}
setImmediate(main);

// frida -U --no-pause -f com.tencent.dm -l c2ddldl
// frida -U --no-pause -f com.xingli.hall_yulewuqiong -l u3dtest
